package org.jgs1904.apachepoidemo.javaoop;

/**
 * @author: 默苍璃
 * @date: 2024-01-17 15:44
 */
class MyClass {
    private int age;
    private String name;
    private boolean isMale;

    // 构造方法1：接收所有属性值
    MyClass(int age, String name, boolean isMale) {
        super();
        this.age = age;
        this.name = name;
        this.isMale = isMale;
    }

    // 构造方法2：只接收年龄和姓名，默认性别为男性
    MyClass(int age, String name) {
        this(age, name, true); // 调用构造方法1
    }

    // 构造方法3：默认年龄为0，姓名为空字符串，性别为男性
    MyClass() {
        this(0, "", true); // 调用构造方法2
    }
}
